define([],function () {
    var tpl = {};
    tpl.modifyEquipInit = function(){
        var html = "";
        html += modifyEquip();
        return html;
    };
    tpl.selectOptionsInit = function(){
        var html = "";
        html += selectOptions();
        return html;
    };
    var selectOptions =  function(){
        return  '<script type = "text/html" id="selectOptions-tpl">'+
                    '<select class="form-control input-sm" id = "selectOptions">'+
                    '<option value ="" >全部</option>'+
                    '{{each data as val,i}}'+
                    '<option value = "{{val.id}}" className="{{val.className}}">{{val.className}}</option>'+
                    '{{/each}}'+
                    '</select>'+
                '</script>'
    };
    var modifyEquip = function(){
        return '<script type = "text/html" id="modifyEquip-tpl">'+
                    '<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" id="myModal">'+
                        '<div class="modal-dialog" role="document">'+
                            '<div class="modal-content">'+
                                '<div class="modal-header">'+
                                    '<h4 class="modal-title" id="equipId" equipId="{{id}}">{{title}}</h4>'+
                                '</div>'+
                            '<div class="clearfix modal-body">'+
                                '<div class="form-group">'+
                                    '<label for="modify-equipType" class="col-sm-3 control-label">设备类型：</label>'+
                                    '<div class="col-sm-8">'+
                                        '<select class="form-control" id = "modify-equipType">'+
                                        '{{each rows as val,i}}'+
                                            '<option value = "{{val.id}}" className="{{val.className}}" {{if classId && classId ==val.id}} selected {{else if i == 0}} selected {{/if}}>{{val.className}}</option>'+
                                        '{{/each}}'+
                                        '</select>'+
                                    '</div>'+
                                '</div>'+
                                '<div class="form-group">'+
                                    '<label for="modify-equipNumber" class="col-sm-3 control-label">设备编号：</label>'+
                                    '<div class="col-sm-8">'+
                                        '<input id="modify-equipNumber" type="text" class="form-control input-sm" value="{{equipAlias}}">'+
                                    '</div>'+
                                '</div>'+
                                '<div class="form-group">'+
                                    '<label for="modify-procedureNumber" class="col-sm-3 control-label">程序编号：</label>'+
                                    '<div class="col-sm-8">'+
                                        '<input id="modify-procedureNumber" type="text" class="form-control input-sm" value="{{programId}}">'+
                                    '</div>'+
                                '</div>'+
                                '<div class="form-group">'+
                                    '<label for="modify-equipDesc" class="col-sm-3 control-label">设备描述：</label>'+
                                    '<div class="col-sm-8">'+
                                        '<input id="modify-equipDesc" type="text" class="form-control input-sm" value="{{equipDesc}}">'+
                                    '</div>'+
                                '</div>'+
                                '<div class="form-group">'+
                                    '<label class="col-sm-3 control-label"></label>'+
                                    '<div class="col-sm-8">'+
                                        '<button type="button" class="btn btn-info" data-dismiss="modal" flag = "1">取消</button>'+
                                        '<button type="button" class="btn btn-info" flag = "0">确定</button>'+
                                    '</div>'+
                                '</div>'+
                            '</div>'+
                        '</div>'+
                    '</div>'+
                '</script>'
    };
    return tpl;
});